<template>
   <div class="container">
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     <!-- <MliList :list="list"></MliList> -->

     <!-- 作用域插槽 -->
     <slot :list="list"></slot>   
  </div>
</template>

<script>   
import axios from "axios";
import Vue from "vue";
import { Skeleton, List, PullRefresh } from "vant";
Vue.use(Skeleton);
Vue.use(List);
Vue.use(PullRefresh);

// import MliList from './MliList'

export default {

components:{
    //  MliList
},

props:['type'],

  data() {
    return {
      list: [],
      isLoading: true,
      loading: false,
      finished: false,
      refreshing: false
    };
  },
  
  methods: {
     
  },
  mounted() {  //获取数据库里的数据

    // let result = axios.get(`./list.json`, {});
    // console.log(result);
    
    let url=this.type

    switch(url){
        case 'Song' : url='./math/mathSong.json';
        break;
        case 'Speak' : url='./math/mathSpeak.json';
        break;
         case 'Music' : url='./math/mathMusic.json';
        break;
         case 'Arder' : url='./math/mathArder.json';
        break;
         case 'Discuss' : url='./math/mathDiscuss.json';
        break;
         case 'Children' : url='./math/mathChildren.json';
        break;
         case 'Sport' : url='./math/mathSport.json';
        break;
         case 'Dance' : url='./math/mathDance.json';
        break;
        
    }

    console.log(url);

    fetch(url)
      .then(response => response.json())
      .then(result => {
        console.log(result.projectInfo)
       
         this.list = result.projectInfo
        
      })
  }
};
</script>



 

<style lang='stylus' scoped>
@import '../assets/ellipsis.styl';

.container {
  
}
</style>